<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreatePosterTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('poster', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name',120)->comment('名称');
            $table->string('description',180)->nullable()->comment('简介');
            $table->unsignedInteger('poster_type',false)->default(1)->comment('推荐位类型 1=图片 2=视频 3=文字');
            $table->unsignedInteger('file_width',false)->nullable()->default(0)->comment('宽度尺寸');
            $table->unsignedInteger('file_height',false)->nullable()->default(0)->comment('高度尺寸');
            $table->boolean('is_sys')->default(false)->comment('是否系统预设');
            $table->timestamps();
            $table->softDeletes();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('poster');
    }
}
